<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>合众人寿公益平台客户管理系统</title>
		<SCRIPT type="text/javascript">
	      var GB_ROOT_DIR = "<%=request.getContextPath()%>/html/skin/";
        </SCRIPT>
		<style>
body,ul,ol,dl,dd,p,h1,h2,h3,h4,h5,h6,form,input,textarea,select,td,th {
	margin: 0;
	padding: 0;
	font-family: "宋体", Arial, Helvetica, sans-serif;
}

li {
	list-style: none;
}

input {
	background: none;
}

.clear {
	zoom: 1;
}

.clear:after {
	content: "";
	display: block;
	clear: both;
}
</style>
		<link href="<%= request.getContextPath() %>/html/css/Main.css"
			rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/html/css/gb_styles.css"
			rel="stylesheet" type="text/css"/>
				<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS_fx.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/gb_scripts.js"></script>
		<script src="<%=request.getContextPath()%>/html/js/Calendar.js"
			charset="utf-8"></script>
		 <link href="<%=request.getContextPath()%>/html/js/My97DatePicker/skin/WdatePicker.css"
			rel="stylesheet" type="text/css" />
		<script src="<%=request.getContextPath()%>/html/js/My97DatePicker/WdatePicker.js"
			charset="utf-8"></script>
	</head>
	<body>
	  <input type="hidden" value="${impDataInfor}" id="impDataInfor"/>
		<div class="container">
			<div class="wrap clear">
				<div class="sub_wp_right">
					<div class="rt_tt">
						<h3 class="tittle">
							发送记录
						</h3>
					</div>
					<div class="ct">
						<form
							action="<%=request.getContextPath()%>/mail/searchMailRecords.do"
							method="post" onsubmit="return check()" name="listForm">
							<h3 class="sm_tt">
								查询条件
							</h3>
							<div class="tiaojian" align="center">
								<table>
									<tr>
										<td align="right">
											<span>发送日期：</span>
										</td>
										<td class="t2" >
											<input type="text" name="startDate" id="startDate"
												value="${startDate}" onfocus="WdatePicker({startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
										</td>
										<td align="right">
											<span>至：</span>
										</td>
										<td class="t2">
											<input type="text" name="endDate" id="endDate"
												value="${endDate}"  onfocus="WdatePicker({endDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
										</td>
										<td class="t2" >
											<div class="btn" >
												<input type="submit" value="查询" />
											</div>

										</td>
									</tr>
								</table>

							</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getStart('发送记录', #request.pm)"
								escape="false" />
							<div class="jieguo">
								<table border="0" cellpadding="0" cellspacing="0"
									class="listArea" width="100%">
									<thead>
										<tr>
											<th>
												发送时间
											</th>
											<th>
												接收人
											</th>
											<th>
												发送内容
											</th>
											<th>
												操作
											</th>
										</tr>
									</thead>
									<tbody id="bg">
										<s:if test="#request.pm.datas.size()==0">
											<tr>
												<td colspan="14" align="center">
													<font color="red">暂无数据!</font>
												</td>
											</tr>
										</s:if>
										<s:else>
											<s:iterator value="#request.pm.datas" var="mailRecord"
												status="status">
												<s:if test="#status.odd == true">
													<tr class="rowNormal"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowNormal'">
												</s:if>
												<s:else>
													<tr class="rowAlternate"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowAlternate'">
												</s:else>
													<td  align="center">
														<s:property value="#mailRecord.sendTime" />
													</td>
													<td  align="center">
														<s:iterator value="#mailRecord.addressees" var="receiver" status="status">
															<s:property value="#receiver.memberName" /> 
														</s:iterator>
													</td>
													<td width="160px">
													   <div class="autoMailContent"
														title="<s:property value="#mailRecord.content" />">
														<s:property value="#mailRecord.content" />
														</div>
													</td>
													<td  align="center">
														<a
															href="<%=request.getContextPath()%>/mail/viewMailRecord.do?mailRecord.mail_id=<s:property value="#mailRecord.mail_id"/>">查看</a>
														<a
															href="javascript:deleteMailRecord(<s:property value="#mailRecord.mail_id"/>);">删除</a>
													</td>
												</tr>
											</s:iterator>
											<tr class="rowAlternate"
												onmouseover="this.className='rowChecked'"
												onmouseout="this.className='rowAlternate'">
											 <td colspan="4"  align="center">
											  	共  <s:property value="#request.pm.total" /> 条发送记录
											 </td>
											</tr>
										</s:else>
									</tbody>
								</table>
							</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getEnd(#request.pm)"
								escape="false" />
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
    function deleteMailRecord(id){
  		if(confirm("是否确认删除？")){
  			window.location.href="<%=request.getContextPath()%>/mail/deleteMailRecord.do?mailRecord.mail_id="+id;
  		}
  	}
  	
  	var impDataInfor = document.getElementById("impDataInfor").value;
  	if(impDataInfor != ''){
  		 GB_showCenter("发送邮件","<%=request.getContextPath()%>/jsp/mail/impDataInfor.jsp?impDataInfor=${impDataInfor}",300,300);
  		document.getElementById("impDataInfor").value = '';
  	}
  </script>
</html>
